/*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

FIVe3D
Flash Interactive Vector-based 3D
Mathieu Badimon  |  five3d@mathieu-badimon.com

http://five3D.mathieu-badimon.com  |  http://five3d.mathieu-badimon.com/archives/  |  http://code.google.com/p/five3d/

/*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

import net.badimon.five3D.display.DynamicText;
import net.badimon.five3D.display.Sprite;

class net.badimon.five3D.utils.ObjectUtilities {

	public static function createSprite(sprite:Sprite, name:String, depth:Number, properties:Object):Sprite {
		var s:Sprite = sprite.createSprite(name, depth);
		initializeProperties(s, properties);
		return s;
	}

	public static function createDynamicText(sprite:Sprite, name:String, depth:Number, properties:Object):DynamicText {
		var t:DynamicText = sprite.createDynamicText(name, depth);
		initializeProperties(t, properties);
		return t;
	}

	public static function initializeProperties(object:Object, properties:Object):Void {
		for (var i:String in properties) object[i] = properties[i];
	}
}